<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>常用模板语法</title>
</head>
<script src="https://unpkg.com/vue@next"></script>
<body>
    <div id="root"></div>
</body>
<script>
    const app = Vue.createApp({
        data() {
            return {
                content:'hello world',
                message: '<span>hello world</span>',
                content1:'hello world',
                disable:true ,
                content2:'hello world',
                content3:'显示hello world',
                show:true
            }
        },
        methods: {
            handlerClick() {
                alert('click')
            },
            click1(){

            }
        },
        // <--插值表达式 !-->
        template: `            
            <div>{{content}}</div>
            <div v-html="message"></div>
            <div v-bind:title="content1">{{content1}}</div>
            <input v-bind:disabled="disable"/>
            <div v-once>{{content2}}</div>
            <div v-if="show">{{content3}}</div>

            <div v-on:click="handlerClick">点击{{content3}}</div>

            <form action="https://www.baidu.com" @click.prevent="click1">
                <button type="submit">提交</button>
            </form>                
        `
    });

    const vm = app.mount('#root');
</script>
</html>


<!-- 
插值表达式
v-html
v-bind:title   属性数据绑定使用 v-bind
v-once
v-if
v-on

指令简写
v-on:click  ====> @click
v-bind      =====> :

动态属性  :[]

@click.prevent 组织默认行为 


 -->